#pragma once
#include<iostream>
#include<pthread.h>
#include"Mutex.hpp"

using namespace Mutex_module;

namespace Cond_module
{
    class Cond
    {
    public:
    Cond()
    {
        pthread_cond_init(&_cond,nullptr);
    }
    void Wait(pthread_mutex_t mut)
    {
        pthread_cond_wait(&_cond,&mut);
    }
    void Signal()
    {
        pthread_cond_signal(&_cond);
    }
    void BroadCast()
    {
        pthread_cond_broadcast(&_cond);
    }
    ~Cond()
    {
        pthread_cond_destroy(&_cond);
    }
    private:
        pthread_cond_t _cond;

    };
}